package com.haizhi.crm.biz.service;

import com.haizhi.crm.biz.model.CustomerVisitRecordQo;
import com.haizhi.crm.biz.model.VisitRecordQo;
import com.haizhi.crm.biz.model.VisitRecordResultVo;
import com.haizhi.crm.biz.model.VisitRecordSearchQo;
import com.haizhi.crm.common.model.Response;

/**
 * 拜访记录service
 * Created by yangyijun on 2018/5/31.
 */
public interface VisitRecordService {

    Response save(VisitRecordQo visitRecordQo);

    Response update(VisitRecordQo visitRecordQo);

    Response findCreators();

    Response findCustomers(String queryType);

    Response search(VisitRecordSearchQo visitRecord);

    Response findById(String objectKey);

    //设置相关属性：协同人员，客户信息
    void setDetailInfo(VisitRecordResultVo visitRecordResult);

    /**
     * ES查询相关联的行内动态
     *
     * @param objectKey
     * @return
     */
    Response findAssociatedInnerEvents(String objectKey);

    /**
     * 查询相关联的产品
     *
     * @param objectKey
     * @return
     */
    Response findAssociatedProducts(String objectKey);


    /**
     * 查询相关联的事件(行外)
     *
     * @param objectKey
     * @return
     */
    Response findAssociatedOuterEvents(String objectKey);

    Response findAssociatedCustomers(String objectKey);

    /**
     * 根据ID删除拜访记录
     *
     * @param visitRecordId
     */
    Response delete(Long visitRecordId);

    /**
     * 查询拜访记录所关联企业的其他拜访记录
     *
     * @param visitRecordId
     * @return
     */
    Response othersVisitRecordOfCompany(Long visitRecordId);

    /**
     * 查询当前用户最近浏览的拜访记录
     *
     * @return
     */
    Response recentViewVisitRecord(int count);

    /**
     * 查询拜访记录相关联的拜访记录
     *
     * @param objectKey
     * @return
     */
    Response findAssociatedVisitRecords(String objectKey);

    Response findAssociatedVisitRecords(String objectKey, String eventSchema);

    /**
     * 查询拜访记录列表(根据title)
     *
     * @param title
     * @return
     */
    Response findByTitle(String title);

    Response findByCustomerKey(CustomerVisitRecordQo customerVisitRecordQo);

}
